package com.mcxx.modules.statistics.entity;

import lombok.Data;

import java.io.Serializable;



@Data
public class StatisDataItemEntity implements Serializable {
    private static final long serialVersionUID = 2639861709631772115L;
    private String id;

    private String area;

    private String areaCode;

    private String businessType;

    private String povertyType;

    private String years;

    private String itemSetId;

    private String statisConfigCode;

    private String statisConfigName;

    private String statisConfigId;

    private Integer statisType;

    private Integer statisUnit;

    private Integer isStatisPerson;

    private Integer isStatisFamily;

    private Integer isSum;

    private Integer isValue;

    private Integer count;

    private Integer familyCount;

    private Double sum;

    private String createTime;

    private String streetCode;

    private String countyCode;

    private String cityCode;

    private String provinceCode;

    private Integer count1;

    private Integer count2;

    private Integer count3;

    private Integer count4;

    private Integer count5;

    private Integer count6;

    private Integer count7;

    private Integer count8;

    private Integer count9;

    private Double sum1;

    private Double sum2;

    private Double sum3;

    private Double sum4;

    private Double sum5;

    private Double sum6;

    private Double sum7;

    private void nullFill0(){
        if(null == this.getFamilyCount()){
            this.setFamilyCount(0);
        }
        if(null == this.getCount()){
            this.setCount(0);
        }
        if(null == this.getCount1()){
            this.setCount1(0);
        }
        if(null == this.getCount2()){
            this.setCount2(0);
        }
        if(null == this.getCount3()){
            this.setCount3(0);
        }
        if(null == this.getCount4()){
            this.setCount4(0);
        }
        if(null == this.getCount5()){
            this.setCount5(0);
        }
        if(null == this.getCount6()){
            this.setCount6(0);
        }
        if(null == this.getCount6()){
            this.setCount6(0);
        }
        if(null == this.getCount7()){
            this.setCount7(0);
        }
        if(null == this.getCount8()){
            this.setCount8(0);
        }
        if(null == this.getCount9()){
            this.setCount9(0);
        }
        if(null == this.getSum()){
            this.setSum(0D);
        }
        if(null == this.getSum1()){
            this.setSum1(0D);
        }
        if(null == this.getSum2()){
            this.setSum2(0D);
        }
        if(null == this.getSum3()){
            this.setSum3(0D);
        }
        if(null == this.getSum4()){
            this.setSum4(0D);
        }
        if(null == this.getSum5()){
            this.setSum5(0D);
        }
        if(null == this.getSum6()){
            this.setSum6(0D);
        }
        if(null == this.getSum7()){
            this.setSum7(0D);
        }
    }

    public void add(StatisDataItemEntity record){
        this.nullFill0();
        if(null != record.getFamilyCount())
            this.setFamilyCount(this.getFamilyCount() + record.getFamilyCount());
        if(null != record.getCount())
            this.setCount(this.getCount() + record.getCount());
        if(null != record.getCount1())
            this.setCount1(this.getCount1() + record.getCount1());
        if(null != record.getCount2())
            this.setCount2(this.getCount2() + record.getCount2());
        if(null != record.getCount3())
            this.setCount3(this.getCount3() + record.getCount3());
        if(null != record.getCount4())
            this.setCount4(this.getCount4() + record.getCount4());
        if(null != record.getCount5())
            this.setCount5(this.getCount5() + record.getCount5());
        if(null != record.getCount6())
            this.setCount6(this.getCount6() + record.getCount6());
        if(null != record.getCount7())
            this.setCount7(this.getCount7() + record.getCount7());
        if(null != record.getCount8())
            this.setCount8(this.getCount8() + record.getCount8());
        if(null != record.getCount9())
            this.setCount9(this.getCount9() + record.getCount9());
        if(null != record.getSum())
            this.setSum(this.getSum() + record.getSum());
        if(null != record.getSum1())
            this.setSum1(this.getSum1() + record.getSum1());
        if(null != record.getSum2())
            this.setSum2(this.getSum2() + record.getSum2());
        if(null != record.getSum3())
            this.setSum3(this.getSum3() + record.getSum3());
        if(null != record.getSum4())
            this.setSum4(this.getSum4() + record.getSum4());
        if(null != record.getSum5())
            this.setSum5(this.getSum5() + record.getSum5());
        if(null != record.getSum6())
            this.setSum6(this.getSum6() + record.getSum6());
        if(null != record.getSum7())
            this.setSum7(this.getSum7() + record.getSum7());
    }

    public void sub(StatisDataItemEntity record) {
        this.nullFill0();
        if(null != record.getFamilyCount())
            this.setFamilyCount(this.getFamilyCount() - record.getFamilyCount());
        if(null != record.getCount())
            this.setCount(this.getCount() - record.getCount());
        if(null != record.getCount1())
            this.setCount1(this.getCount1() - record.getCount1());
        if(null != record.getCount2())
            this.setCount2(this.getCount2() - record.getCount2());
        if(null != record.getCount3())
            this.setCount3(this.getCount3() - record.getCount3());
        if(null != record.getCount4())
            this.setCount4(this.getCount4() - record.getCount4());
        if(null != record.getCount5())
            this.setCount5(this.getCount5() - record.getCount5());
        if(null != record.getCount6())
            this.setCount6(this.getCount6() - record.getCount6());
        if(null != record.getCount7())
            this.setCount7(this.getCount7() - record.getCount7());
        if(null != record.getCount8())
            this.setCount8(this.getCount8() - record.getCount8());
        if(null != record.getCount9())
            this.setCount9(this.getCount9() - record.getCount9());
        if(null != record.getSum())
            this.setSum(this.getSum() - record.getSum());
        if(null != record.getSum1())
            this.setSum1(this.getSum1() - record.getSum1());
        if(null != record.getSum2())
            this.setSum2(this.getSum2() - record.getSum2());
        if(null != record.getSum3())
            this.setSum3(this.getSum3() - record.getSum3());
        if(null != record.getSum4())
            this.setSum4(this.getSum4() - record.getSum4());
        if(null != record.getSum5())
            this.setSum5(this.getSum5() - record.getSum5());
        if(null != record.getSum6())
            this.setSum6(this.getSum6() - record.getSum6());
        if(null != record.getSum7())
            this.setSum7(this.getSum7() - record.getSum7());
    }
}
